import  http  from "/src/utils/http";

export function pList(body) {
    return http.get('/post/posts');
}

export function addPost(body) {
    return http.post('/post/add', body);
}

export function getPost(body) {
    return http.post('/post/get',JSON.stringify(body), {
        headers: {
            'Content-Type': 'application/json' // 显式设置 Content-Type 为 JSON
        }})
}

export function update(body) {
    return http.post('/post/update', body);
}

export function deletePost(body) {
    return http.post('/post/delete',JSON.stringify(body), {
        headers: {
            'Content-Type': 'application/json' // 显式设置 Content-Type 为 JSON
        }})
}
// 使用命名导入